/*
 * @Author: wangliang
 * @Date: 2018-05-09
 * @description: 列表页
*/

import { apiHttp } from '../../apiHttp';
import Api from '../../../api/company/companyController.api';
import { JsonResult } from '../../../api/Interface';
import { CompanyListSearchDto } from '../../../service/subject/company/companyInterface';
export default {
    // 获取列表
    companyPage: async (companyList: CompanyListSearchDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.companyPage, companyList);
        return res;
    },
    // 获取统计数据
    getCompanyCountInfo: async (): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getCompanyCountInfo, '');
        return res;
    },
    // 删除
    deleteCompany: async (delId: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.deleteCompany, {id: delId});
        return res;
    },
    // 删除前查询关系
    getDeleteCompanyCheck: async (delId: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getDeleteCompanyCheck, {companyId: delId});
        return res;
    },
};